﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SpecF.Reporting;

namespace SpecF
{
    public abstract class SpecBase<T>
    {
        protected internal SpecOwnerInformation SpecOwner
        {
            get;
            set;
        }

        protected internal IReportingEngine Reporter
        {
            get;
            set;
        }
        internal List<Next<T>> Conditions
        {
            get;
            set;
        }

        internal static List<SpecF<T>> Specs
        {
            get;
            set;
        }

        static SpecBase()
        {
            Specs = new List<SpecF<T>>();
             
        }
        internal SpecBase()
        {
            this.Conditions = new List<Next<T>>();
            SpecOwner = new SpecOwnerInformation();
            InitSpecOwnerInformation();
        }

        private void InitSpecOwnerInformation()
        {
            SpecOwner.Name = typeof(T).Name;
        }

        internal static void RegisterSpec(SpecF<T> spec)
        {
            Specs.Add(spec);
        }

        protected internal abstract void ReportInternal(ReporterType reporterType);
    }
}